import java.util.HashMap;
import java.util.Map;


public class Run {

	static int sims = 15;
	static int currentSim = 0;
	public static Map<Agent, Integer> wins = new HashMap<Agent, Integer>();
	public static Map<Agent, Integer> money = new HashMap<Agent, Integer>();
	public static void main(String[] args)
	{
		Simulator sim = new Simulator();
		sim.loadAgents(args);
		for (Agent a:sim.agents)
		{
			wins.put(a, 0);
			money.put(a,0);
		}
		System.out.println("Agents Loaded");
		for (int i = 0; i < sims; i++)
		{
			currentSim = i;
			sim.startSimulation();
			Agent winner = sim.agents.get(0);
			for (Agent a:sim.agents)
			{
				if (a.money > winner.money)
					winner = a;
				
				money.put(a, money.get(a) + a.money);
				
			}
		
			
			wins.put(winner, wins.get(winner)+ 1);
			
			//reset money
			for (Agent a:sim.agents)
			{
				a.money = Agent.BASE_MONEY;
			}
		
		}
		
		
		System.out.println("Total wins:");
		for (Agent a:sim.agents)
		{
			String output = a.name+" "+wins.get(a)+" "+money.get(a);
			System.out.println(output);
		}
	}
}
